import 'package:yt_devops/model/install_provider_model.dart';
import 'package:yt_devops/model/user_model.dart';
import 'package:yt_devops/utils/func_utils.dart';

class CreateInstallTaskModel {
  UserModel? customer;
  InstallProviderModel? installProvider;
  String? phone;
  String? address;
  String? timeOfAppointment;
  String? content;

  bool isAllFilled() {
    if (customer != null &&
        installProvider != null &&
        !FuncUtils.isEmpty(phone) &&
        !FuncUtils.isEmpty(address) &&
        !FuncUtils.isEmpty(timeOfAppointment) &&
        !FuncUtils.isEmpty(content)) {
      return true;
    } else {
      return false;
    }
  }

  Map<String, dynamic> toRequestParams() {
    return {
      "orgId": installProvider!.orgId!,
      "userId": customer!.userId!,
      "phone": phone,
      "address": address,
      "timeOfAppointment": timeOfAppointment,
      "content": content
    };
  }
}
